package org.lyd.spring.restful.comom;

import lombok.Data;

/**
 * @Author:lyd
 * 自定义异常类
 **/
@Data
public class BizException extends RuntimeException {
    private Integer code;
    private String message;

    public BizException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
    public BizException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }
}
